<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button class="btn">注册用户</button>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script>
  document.querySelector('.btn').addEventListener('click',()=>{
    axios({
        URL:'http://hmajax.ithema.net/api/register',
        method:'post',
        data:{
            username:'jinkai',
            password:'12121'
        }
    }).then(result=>{
        console.log(result);
    })
  })
        
    </script>
</body>
</html>